<template>
  <div class="dashboard-container">
      <div style="float:left">
          <div class="title">
            {{time_hello}}，{{name}}<br/><br/>
            欢迎进入企业人员管理系统！
            
        </div>
      </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import router from '@/router';

export default {
  name: 'Person',
  time_hello: null,
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods:{
      getTimeHello(){
          var myTime=new Date().getHours();
          if(myTime>=6 && myTime<=10){
              this.time_hello="早上好"
          }
          else if(myTime>=11 && myTime<=14){
              this.time_hello="中午好"
          }
          else if(myTime>=15 && myTime<=18){
              this.time_hello="下午好"
          }
          else if(myTime>=19 && myTime<=22){
              this.time_hello="晚上好"
          }
          else{
              this.time_hello="夜深了"
          }
      }
  },
  created(){
      this.getTimeHello();
  }
}
</script>

<style lang="scss" scoped>

.title{
    font-size: 32px;
    color: darkgrey;

}

.content-1{
    font-size: 16px;
    font-weight: 800;
}

.content-2{
    font-size: 16px;
}

.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
